Skip to content

Load newest blogging prompts#25566

Merged
crazytonyli merged 4 commits into
trunkfrom
bugfix/CMM-2068-fix-prompts-fetching
May 22, 2026
Merged

Load newest blogging prompts#25566
crazytonyli merged 4 commits into
trunkfrom
bugfix/CMM-2068-fix-prompts-fetching

Conversation

@crazytonyli
Copy link
Copy Markdown
Contributor

@crazytonyli crazytonyli commented May 19, 2026

Description

Fixes https://linear.app/a8c/issue/CMM-2068.

Align the API call with calypso

The first commit only contains code format changes. The second commit is the real change.

Dashboard Prompts List
home list

Add order=desc to the request and pin force_year to the current year
(using the Gregorian calendar) so the server always returns prompts
stamped with the right year, including around year boundaries where
fetchListPrompts spans late December into early January.
@crazytonyli crazytonyli added this to the 26.9 milestone May 19, 2026
@crazytonyli crazytonyli requested a review from jkmassel May 19, 2026 02:43
@dangermattic
Copy link
Copy Markdown
Collaborator

dangermattic commented May 19, 2026

1 Warning
⚠️ This PR is assigned to the milestone 26.9. The due date for this milestone has already passed.
Please assign it to a milestone with a later deadline or check whether the release for this milestone has already been finished.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Copy Markdown
Contributor

wpmobilebot commented May 19, 2026

App Icon📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack
ConfigurationRelease-Alpha
Build Number32290
VersionPR #25566
Bundle IDcom.jetpack.alpha
Commit22cc4fb
Installation URL6atoasn0o1i90
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot
Copy link
Copy Markdown
Contributor

wpmobilebot commented May 19, 2026

App Icon📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress
ConfigurationRelease-Alpha
Build Number32290
VersionPR #25566
Bundle IDorg.wordpress.alpha
Commit22cc4fb
Installation URL5uc1rsh81g67o
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

Copy link
Copy Markdown
Contributor

@jkmassel jkmassel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few suggestions, but then this is good to go

let date = try passedDate()
XCTAssertEqual("2022-01-02", try passedDate())
// `force_year` is now always the current year, so the reconstructed date carries it.
let currentYear = Calendar(identifier: .gregorian).component(.year, from: Date())
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this be flaky in early January?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How's so? I don't think it'd be flaky? The same code is used to assign a value to the force_year parameter.

Comment thread Tests/KeystoneTests/Tests/Services/BloggingPromptsServiceTests.swift Outdated
crazytonyli and others added 2 commits May 22, 2026 10:54
Co-authored-by: Jeremy Massel <1123407+jkmassel@users.noreply.github.com>
Co-authored-by: Jeremy Massel <1123407+jkmassel@users.noreply.github.com>
@crazytonyli crazytonyli added this pull request to the merge queue May 22, 2026
Merged via the queue into trunk with commit 08e1b0c May 22, 2026
24 checks passed
@crazytonyli crazytonyli deleted the bugfix/CMM-2068-fix-prompts-fetching branch May 22, 2026 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants